<?php
class KarmaMapper{
    public function getListProById($user_id){
        $db = Database::getInstance();
        $resultSet = $db->fetchAll('karma_pro WHERE user_id = ' . $user_id);
        $karmas = array();
        $user = new UserModel();
        //$messages = array();
        foreach($resultSet as $one){
            $karmas[] = $user->find($one['vote_user_id']);

        }
        return $karmas;
    }

    public function getListContraById($user_id){
        $db = Database::getInstance();
        $resultSet = $db->fetchAll('karma_contra WHERE user_id = ' . $user_id);
        $karmas = array();
        $user = new UserModel();
        //$messages = array();
        foreach($resultSet as $one){
            $karmas[] = $user->find($one['vote_user_id']);
        }
        return $karmas;
    }
}
?>
